package aop.springAop;

import org.aspectj.lang.ProceedingJoinPoint;

public class CityTwoDaoAspect {
//	public void before(JoinPoint joinPoint) {
//		Object[] args = joinPoint.getArgs();
//		if (args != null) {
//			System.out.printf("方法:" + joinPoint.getSignature().getName() + ",入参:%s\n", args);
//		}
//		System.out.println("before");
//	}
//
//	public void after() {
//		System.out.println("after....");
//	}
//
//	public void throwing() {
//		System.out.println("throwing...");
//	}
//
//	public void returning(JoinPoint joinPoint) {
//		// 调用目标方法
//	Object returnValue = joinPoint.proceed();
//	//方法名
//	String methodName = joinPoint.getSignature().getName();
//	String classsName = joinPoint.getTarget().getClass().getName()+".";
//
//	System.out.printf(classsName+methodName+"返回值:%s\n", returnValue);
//	}
	public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
		// 调用目标方法
		Object returnValue = joinPoint.proceed();
		//方法名
		String methodName = joinPoint.getSignature().getName();
		String classsName = joinPoint.getTarget().getClass().getName()+".";

		System.out.printf(classsName+methodName+"返回值:%s\n", returnValue);
		return returnValue;
	}

	
}
